package com.qdlc.p2p.common.util;

import com.redfin.sitemapgenerator.WebSitemapGenerator;
import com.redfin.sitemapgenerator.WebSitemapUrl;

import java.io.File;
import java.net.MalformedURLException;
import java.util.Set;

/**
 * Created by hongbinglin on 2016/6/6.
 */
public class siteMapUtil {
    public static void sitemapGenerator(Set<String> linkSet,String url) throws MalformedURLException {
        // If you need gzipped output
        WebSitemapGenerator sitemapGenerator = WebSitemapGenerator
                .builder("https://www.99jzg.com", new File(url))
                .gzip(false).build();

        for (String webUrl : linkSet) {
            WebSitemapUrl sitemapUrl = new WebSitemapUrl.Options(webUrl).build();
            sitemapGenerator.addUrl(sitemapUrl);
        }
        sitemapGenerator.write();
    }
}
